package com.xiaoming.project.core;

public class MapTest {

    private static void hashMapGenerateSize() {
        // 哈希map生成容器大小的逻辑
        // 根据输入的值-1对应二进制最高位上一位的值减一，然后再加1
        int n = 4;
        n |= n >>> 1;
        n |= n >>> 2;
        n |= n >>> 4;
        n |= n >>> 8;
        n |= n >>> 16;
        System.out.println(n);
        System.out.println(n >>> 1);
        System.out.println(n | 0);
    }

}